Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext


~Hal Nonamarli 15.Dec.03 02:48 PM a Web browser
Domino Designer 6.5 Windows NT


We have an application that uses 4 Java Agents, we are evaluating R6.5 and are running into JVM memory issues.

These agents run fine with NO recycling of objects or garbage collection on and R5 server, they are used extensively and never fall over.

On R6.5 they will only run about 20 times before the JVM runs out of memory and cannot get the attachments (.jar files) stored in the ScriptLibrary.

I have put in recycling and garbage collection into the agents but this still happens (they run a bit longer). I am not a Java expert, but cannot see why they run under R5 and Notr R6.5 I feel 6.5 has a memory leak problem...

My code is below any help pointers very much appreciated, as this may stop our entire Notes 6.5 rollout in its tracks...

import lotus.domino.*;
import JHCTS.Beans.*;
import java.util.Vector;
import java.io.* ;

public class JavaAgent extends AgentBase {

protected Session session;
protected AgentContext agentContext;
protected Database db;
protected Document doc;
protected String PC;
protected Document profileDoc;
protected String emailGroup;

/**
*This method allows the Agent to send email, with varied errorMessage, serverName, and clientRef
*@param java.lang.String errorMessage - the error message to appear in the body of the email
*@param java.lang.String serverName - the name of the originating server
*@param java.lang.String clientRef - the client reference
*@param lotus.domino.Database theDatabase - the database used by the method to fomulate an email
*/
public void sendEmail(String errorMessage, Database theDatabase) {

//set the variables for use in the scope of this method from the method header
String theErrorMessage = errorMessage;
Database ourDatabase = theDatabase;

try{
//create document to be cast as an email
Document mail = ourDatabase.createDocument();

mail.appendItemValue("Form","Memo"); //type the document, make it a mail.
mail.appendItemValue("Subject", theErrorMessage); //set the error message from the method header.
Vector v = new Vector(); //create vector
v.addElement(emailGroup); //add address to vector
mail.send(v); //send mail to all address in the vector
}
//catch any Notes Exceptions which may occur
catch (NotesException argh) {
//unhandled exception
// if you are getting exceptions in this class, you are in trouble.
}
//catch any other Exceptions which may occur
catch(Exception argh) {
//still unhandled
}
}

/**
*This method mirrors the idea of a Java constructor inside the agent, allowing it to be called more than once in less lines of working code.
*/
public void createFixture() {
try{
session = getSession(); //set the session variable
agentContext = session.getAgentContext(); //set the context
db = agentContext.getCurrentDatabase(); //set the database
doc = agentContext.getDocumentContext(); //set the document
profileDoc = db.getProfileDocument("SystemProfile","");
emailGroup = profileDoc.getItemValueString(" EmailGroupErrors");
}
catch(NotesException urgh) {
String errorMessage = new String("Error - Client Inception Error - Failed General Exception \n\n\n " + urgh);
this.sendEmail(errorMessage, db);
}
catch(Exception urgh) {
String errorMessage = new String("Error - Client Inception Error - Failed General Exception \n\n\n " + urgh);
this.sendEmail(errorMessage, db);
}
}

/**

*This method separates the QAS Call feature into it's own method.
*/
public void QASCall() {
try {
PC = doc.getItemValueString("QAS_PostCode");

// Begin JHCTS QAS Calls
ValidateAddressBean vab = new ValidateAddressBean();
vab.setPostCode(PC);
vab.doTransaction();

if ( vab.getSucceeded() ) {
String postAddress = vab.getPostalAddress();
int itemListSize = vab.getAddressListSize();

// Process values using an array
Vector v = new Vector();

int count = 0;
while (count < itemListSize ) {
String addressItem = vab.getItemList(count);
v.addElement(addressItem);
count++;
}

Item textListItem = doc.replaceItemValue("QAS_Text", null);
textListItem.setValues(v);
textListItem.setSummary(true);
// Recycle Objects
textListItem.recycle();
doc.recycle();
agentContext.recycle();
db.recycle();
session.recycle();

}
// Recycle Objects
doc.recycle();
agentContext.recycle();
db.recycle();
session.recycle();
System.runFinalization();
System.gc();
}
catch(Exception e) {
e.printStackTrace();
try {
this.createFixture();
this.sendEmail("Error Code 1005 - Client Inception Errors - Quick Address Transaction Failed",db);

} catch(Exception uh) {
//This is not handled!
}
e.printStackTrace();
}
// garbage collection
System.runFinalization();
System.gc();
}

//MAIN METHOD
public void NotesMain() {

this.createFixture();
this.QASCall();

}
}


Many Thanks in advance






JVM Memory - and tearing last of ha... (~Hal Nonamarli 15.Dec.03)
. . RE: JVM Memory - and tearing last o... (~August Ciskrol... 16.Dec.03)
. . . . RE: JVM Memory - and tearing last o... (~Hal Nonamarli 16.Dec.03)
. . JVM Memory - Update (~Hal Nonamarli 19.Dec.03)
. . RE: JVM Memory - and tearing last o... (~Tate Cisnugeny... 16.Dec.03)
. . . . RE: JVM Memory - and tearing last o... (~Hal Nonamarli 16.Dec.03)
. . RE: JVM Memory - and tearing last o... (~Keiko Asakimar... 18.Dec.03)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS